1 package jrre.instructionset.comparison;
2
3 import jrre.Stack;
4 import jrre.types.FloatType;
5 import jrre.types.PrimitiveType;
6
7 public class FCmpg extends jrre.instructionset.Instruction {
8
9 public FCmpg(){
10
11 name = "fcmpg";
12 description = "foo foo moo poo";
13 length = 0;
14 }
15
16 public void execute(){
17
18 FloatType floatTwo = (FloatType)Stack.popOperand();
19 FloatType floatOne = (FloatType)Stack.popOperand();
20
21 float valueOne = floatOne.getValue();
22 float valueTwo = floatTwo.getValue();
23
24 if(valueOne == valueTwo)
25 Stack.pushOperand(new PrimitiveType(0));
26 else if(valueOne > valueTwo)
27 Stack.pushOperand(new PrimitiveType(1));
28 else
29 Stack.pushOperand(new PrimitiveType(-1));
30
31 }
32
33 public String toString(){
34 return "fcmpg";
35 }
36 }
This page was automatically generated by Maven